<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<html>
<head>
<title>帐号管理</title>
<script>
	 $(document).ready(function() {
		 $("#message").fadeOut(3000);
	});
	</script>
</head>

<body>
	<h4 class="prepend-top">权限组列表</h4>
	<c:if test="${not empty message}">
		<div id="message" class="success">${message}</div>
	</c:if>
	<c:if test="${not empty errormessage}">
		<div id="errormessage" class="error">${errormessage}</div>
	</c:if>

	<table id="contentTable">
		<tr>
			<th width="7%" align="center">名称</th>
			<th width="83%" align="center">授权</th>
			<shiro:hasPermission name="group:edit">
				<th width="10%" align="center">操作</th>
			</shiro:hasPermission>
		</tr>
		<c:forEach items="${groups}" var="group">
			<tr>
				<td>${group.name}</td>
				<td>${group.permissionNames}</td>
				<shiro:hasPermission name="group:edit">
					<td><a href="update/${group.id}" id="editLink-${group.name}">修改</a>
						<a href="delete/${group.id}">删除</a></td>
				</shiro:hasPermission>
			</tr>
		</c:forEach>
	</table>

	<shiro:hasPermission name="group:edit">
		<a href="create">创建权限组</a>
	</shiro:hasPermission>
</body>
</html>
